stage.set_background("pond")
sprite = codesters.Sprite("turtle1")
sprite.set_size(.5)
sprite.pen_down()
sprite.set_color("yellow")
for counter in range(5):
# add code here
sprite.move_forward(50)
sprite.turn_left(90)
t = codesters.Teacher()
try:
params = t.find_function('turn_left')
tval2a = params[0][1]
tval2b = t.get_indent_at_line(params[0][0])
except:
tval2a = "DNE"
tval2b = "DNE"
# print tval1
# t1 = TestObjective()
# t1.add_success('for counter in range' in tval1, "Great job!")
# t1.add_failure(tval1 == [] or tval1 == "DNE", "Did you delete your for loop?")
t2 = TestObjective()
t2.add_success('(92)' in tval2a and tval2b == 4, "Great job!")
t2.add_failure(tval2a == "DNE", "Did you delete the Turn Left command?")
t2.add_failure(tval2b != 4, "Make sure your Turn Left command is indented four spaces to be inside the loop.")
t2.add_failure('(90)' in tval2a, "Did you change the number of degrees the sprite turns in the loop?")
tester = TestManager()
tester.add_test_list([t2])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)